package ru.duma.core;

/**
 * @author  cpp
 */
public class AISymbolManager {

    private static AISymbolManager _instance = null;

    private AISymbolManager() { fillObjects(); }

    public static AISymbolManager getInstance() {
        if (_instance == null)
            _instance = new AISymbolManager();
        return _instance;
    }
	
	private AICharacterObject[] objects = new AICharacterObject[Character.MAX_VALUE]; 
	
	private void fillObjects() {
		for(int i = 0; i < objects.length; i++) {
			objects[i] = new AICharacterObject((char)i);
		}
	}
	
	public AIObjects parse(String input) throws EAIException {
		AIObjects result = new AIObjects();
		for (int i = 0; i < input.length(); i++ ) {
			AICharacterObject co = objects[input.charAt(i)];
			result.addObject(co);
		}
		return result;
	}

}
